<template>
  <div class="enter-container">
    <div
      class="enter-item"
      v-for="(item,index) in enters"
      :key="index"
      @click="onEnter(item)">
      <router-link :to="item.link">
        <van-icon :name="item.icon"></van-icon>
        <p v-text="item.name"></p>
      </router-link>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      enters: [
        {
          icon: require('../../../assets/images/enters/face.png'),
          name: '脸部轮廓',
          link: '/home'
        },
        {
          icon: require('../../../assets/images/enters/acid.png'),
          name: '玻尿酸',
          link: '/home'
        },
        {
          icon: require('../../../assets/images/enters/eye.png'),
          name: '眼部',
          link: '/home'
        },
        {
          icon: require('../../../assets/images/enters/nose.png'),
          name: '鼻部',
          link: '/home'
        },
        {
          icon: require('../../../assets/images/enters/body.png'),
          name: '美体塑形',
          link: '/home'
        },
        {
          icon: require('../../../assets/images/enters/fat.png'),
          name: '脂肪填充',
          link: '/home'
        },
        {
          icon: require('../../../assets/images/enters/cusp.png'),
          name: '空腔牙科',
          link: '/home'
        },
        {
          icon: require('../../../assets/images/enters/breast.png'),
          name: '美胸',
          link: '/home'
        },
        {
          icon: require('../../../assets/images/enters/skin.png'),
          name: '美肤',
          link: '/home'
        },
        {
          icon: require('../../../assets/images/enters/senile.png'),
          name: '抗衰老',
          link: '/home'
        },
      ]
    }
  },
  methods: {
    onEnter(item) {
      this.$toast('入口：' + item.name)
    }
  }
}
</script>

<style lang="scss" scoped>
@import "../../../assets/style/global.scss";

.enter-container {
  width: 100%;
  @include center;
  flex-wrap: wrap;
  padding: 10px 20px;
  box-sizing: border-box;
  .enter-item {
    width: 20%;
    margin-top: 6px;
    a {
      @include flex(column);
      img {
        width: 80%;
        height: 80%;
        border-radius: 50%;
      }
      p {
        font-size: 12px;
      }
    }
  }
}
</style>